<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <div id="time">2019-9-9</div>
    <ul id="ul">
        <li>知否，知否你是很聪明的1</li>
        <li>知否，知否你是很聪明的2</li>
        <li>知否，知否你是很聪明的3</li>
        <li>知否，知否你是很聪明的4</li>
        <li>知否，知否你是很聪明的5</li>
    </ul>
    <script>
        var timer = document.getElementById('time');
        time.style.color = 'blue';
        //返回的是 获取过来的元素对象的集合 以伪数组的形式存储
        var uls = document.getElementById('ul');
        var lis = ul.getElementsByTagName('li');
        for (var i = 0; i < lis.length; i++) {
            lis[i].style.color = 'red';
        }
    </script>
</body>

</html>